#ifndef GRAPHICSWRAPPER_H_
#define GRAPHICSWRAPPER_H_

#include "Area.h"
#include "Color.h"
#include "Texture.h"
#include "SDL2/SDL.h"
#include <iostream>

class GraphicsWrapper
{
public:
    virtual ~GraphicsWrapper();

    static void init();
    static void quit();
    static void openWindow(int width, int height);
    static void put(SDL_Texture* texture, const Area& area);
    static void clear();
    static void flip();
    static Texture* fillRectCached(const Size& size, const Color& color);
    static Texture* createText(std::string text, unsigned int fontSize, const Color& color);
    static Texture* loadImageCached(std::string path, int alpha);
    static Texture* loadBlockCached(const Size& size, const Color& color);

private:
    static void free(SDL_Surface* surface);
    static Texture* loadBlock(const Size& size, const Color& color);
    static Texture* createTexture(SDL_Surface* surface, int alpha);
    static SDL_Surface* fillRectSurface(const Size& size, const Color& color);
    GraphicsWrapper();
};

#endif
